

#import "MultiTitleView.h"


@implementation MultiTitleView

- (id)create{
	return [self initWithFrame:CGRectMake(0.0, 0.0, 300.0, 44.0)];
}

- (id)initWithFrame:(CGRect)frame {
    if ((self = [super initWithFrame:frame])) {
        // Initialization code
		self.backgroundColor = [UIColor clearColor];
		
		mainLabel = [[UILabel alloc] initWithFrame:CGRectMake(0.0, 10.0, 300.0, 24.0)];
		mainLabel.backgroundColor = [UIColor clearColor];
		mainLabel.opaque = NO;
		mainLabel.textColor = [UIColor whiteColor];
		mainLabel.textAlignment = UITextAlignmentCenter;
		mainLabel.adjustsFontSizeToFitWidth = YES;
		mainLabel.font = [UIFont boldSystemFontOfSize:20];
		[self addSubview:mainLabel];
		mainLabel.autoresizingMask = nMCViewAutoresizingMask;
		
		subLabel = [[UILabel alloc] initWithFrame:CGRectMake(250.0, 10.0, 50.0, 24.0)];
		subLabel.backgroundColor = [UIColor clearColor];
		subLabel.opaque = NO;
		subLabel.textColor = [UIColor whiteColor];
		subLabel.textAlignment = UITextAlignmentRight;
		subLabel.adjustsFontSizeToFitWidth = YES;
		subLabel.font = [UIFont boldSystemFontOfSize:20];
		[self addSubview:subLabel];
		subLabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleRightMargin;
    }
    return self;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (void)dealloc {
	[mainLabel release];
	[subLabel release];
    [super dealloc];
}

// 设置主标题
- (void)setMainTitle:(NSString *)aMainTitle
{
	mainLabel.text = aMainTitle;
}

// 设置次标题
- (void)setSubTitle:(NSString *)aSubTitle
{
	subLabel.text = aSubTitle;
}


@end
